﻿using DFGK_WMS.IRepository;
using DFGK_WMS.WebAPI.Controllers.Result;
using Microsoft.AspNetCore.Mvc;

namespace DFGK_WMS.WebAPI.Controllers.基础数据
{
    [Route("api/[controller]/[action]")]
    [ApiController]
    public class ExcelUrlController : ControllerBase
    {
        private readonly ITExcelRepository _excelRepository;

        public ExcelUrlController(ITExcelRepository excelRepository)
        {
            _excelRepository = excelRepository;
        }


        /// <summary>
        /// 获取所有文件下载地址
        /// </summary>
        /// <returns></returns>
        [HttpGet]
        public IActionResult GetAllExcelUrls()
        {
            var list = _excelRepository.GetAllExcelUrls();
            if(list.Count() > 0)
            {
                return Ok(BaseResult.Result(list, "查询成功！", "200"));

            }
            return Ok(BaseResult.Result(null, "查询失败！", "200"));
        }
    }
}
